import 'package:flutter/material.dart';
import 'package:flutter_one/class/appbase/BaseView.dart';
import 'package:flutter_one/class/appsetting/setting.dart';
import 'package:flutter_one/class/utils/Utils.dart';

import '../vm/OrderPageViewModel.dart';

class OrderPageView extends StatefulWidget {
  const OrderPageView({super.key});

  @override
  State<OrderPageView> createState() => _OrderPageViewState();
}

class _OrderPageViewState extends State<OrderPageView> {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return BaseView<OrderPageViewModel>(
        viewModel: OrderPageViewModel(),
        build: (context, viewModel, child) {
          return Scaffold(
            backgroundColor: K_APP_BACKGROUND_COLOR,
            appBar: Utils.shareInstance.customPageBar('订单'),
            body: _setBody(),
          );
        },
        onModelReady: (viewModel) {
          //...
          debugPrint("Order-onModelReady");
        });
  }
}

/*扩展*/
extension on _OrderPageViewState {

  Widget _setBody() {
    debugPrint("_OrderPageViewState-_setBody");
    return const Text('我的订单');
  }
}